<?

if (POST) {
    switch (PARAMS) {
        case 'add': tag::paste($_POST);
            break;
        case 'share':
            tag::share(array('tagID' => $_POST['tagID'], 'post' => $_POST['post']));
            break;
        case 'shareremove':
            tag::shareremove(array('ID' => $_POST['ID'], 'tagID' => $_POST['tagID']));
            break;
        case 'comment':
            tag::comment(array('senderID' => UID, 'itemID' => $_POST['ID'], 'comment' => $_POST['comment']));
            break;
        case 'removecomment':
            tag::post(array('tagID' => $_POST['tagID'], 'post' => $_POST['post']));
            break;
        case 'del':
            tag::remove($_POST);
            break;
    }
} else {
    $data->tag = tag::info(PARAMS);
    $data->tag->users = tag::users($data->tag->ID);
    $data->tag->shares = tag::shares($data->tag->ID);
}
?>
